/**     
 * @{#} AddCommand.java Create on 2011-7-22 下午12:34:14     
 *     
 * Copyright (c) 2011 by xiaofeng.zhouxf     
 */
package com.sefer.memcached.command;

import java.util.List;

/**
 * add command
 * 
 * @author <a href="mailto:xiaofeng.zhouxf83@gmail.com">xiaofeng.zhouxf</a>
 * @version 1.0
 */
public class AddCommand extends AbstractCommand {

	public AddCommand(String key, String message) {
		super(key, message);
	}

	@Override
	public String getName() {
		return "add";
	}

	@Override
	public boolean validateResult(String result) {
		return result.contains("STORED");
	}

	@Override
	public String generateCommand() {
		String cmd = String.format("%s %s %d %d %d\r\n", getName(), key, 2,
				expireTime, message.length());
		return cmd;
	}

}
